<script>

export const FormStruct = {
  name: '',
  relationship: '',
  contact: ''
}

export default {
  props: {
    value: {
      type: Object,
      required: true,
      default() {
        return { ...FormStruct }
      }
    }
  },
  computed: {
    form: {
      get() {
        return this.value
      },
      set(form) {
        this.$emit('input', form)
      }
    }
  }
}
</script>

<template>
  <div class="emergency-contact-container">
    <el-form :model="form" label-position="top">

      <el-form-item label="姓名">
        <el-input v-model="form.name" placeholder="请填写姓名" />
      </el-form-item>

      <el-form-item label="关系">
        <el-input v-model="form.relationship" placeholder="请填写关系" />
      </el-form-item>

      <el-form-item label="联系电话">
        <el-input v-model="form.contact" placeholder="请填写联系电话" />
      </el-form-item>

    </el-form>
  </div>
</template>

<style lang="scss"></style>
